fix: update Java README transaction examples to transactions() API - #719
Conversation
Replace disableTransactions(bool) with the affirmative transactions(bool) in the write examples and non-transaction mode note. Regenerating the Java SDK propagates this to java-sdk README write examples. Refs #718
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe Java SDK README replaces ChangesJava transaction documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Not ready to approve
The non-transaction example includes a now-misleading transactionChunkSize inline comment that incorrectly references transactions and should be updated for correctness.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Updates the Java README mustache template in this SDK generator so generated Java SDK documentation uses the affirmative write transaction option API (transactions(boolean)) instead of the double-negative disableTransactions(boolean).
Changes:
- Swapped
.disableTransactions(false)to.transactions(true)in the transactional write example. - Swapped
.disableTransactions(true)to.transactions(false)in the non-transaction mode example and updated the explanatory note accordingly.
File summaries
| File | Description |
|---|---|
| config/clients/java/template/README_calling_api.mustache | Updates generated Java README write examples to use the transactions(...) API. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@config/clients/java/template/README_calling_api.mustache`:
- Line 291: Update the SDK generation contract in docs/GENERATING-A-NEW-SDK.md
and related client contract documentation to use the same transactions API as
the Java template’s .transactions(...) call. Replace references to
ClientWriteOptions.disableTransactions(...) unless this README intentionally
targets a newer API, and keep all generation guidance consistent with the
version being generated.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b79963f9-bf91-4fba-8c7a-47717cd13277
📒 Files selected for processing (1)
config/clients/java/template/README_calling_api.mustache
Address review feedback on the write examples. Correct the prose that said writes are sent sequentially; the SDK splits them into chunks sent in parallel, each chunk its own transaction. Reword the transactionChunkSize inline comment so it no longer reads as contradictory in non-transaction mode. Docs only, no behavior change. Refs #718
There was a problem hiding this comment.
🟢 Ready to approve
The change is limited to Java README template wording/API usage updates and is internally consistent with no remaining references to disableTransactions in the repo.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Summary
Updates the Java README template so the write examples teach the affirmative transaction API (
transactions(boolean)) instead of the double-negativedisableTransactions(boolean). The new API was added in openfga/java-sdk#352; both APIs coexist today anddisableTransactionsis not deprecated yet.The template is the source of truth: the java-sdk
README.mdis generated, so its transaction examples cannot be fixed in java-sdk directly.Changes
config/clients/java/template/README_calling_api.mustache, three lines:.disableTransactions(false)becomes.transactions(true)in the transactional write example.disableTransactions(true)becomes.transactions(false)in the non-transaction mode example, with.transactionChunkSize(5)kept alongside it.transactions(false)instead of.disableTransactions(true)Verification
Regenerated the Java SDK locally with
make build-client-java. The generated README shows.transactions(true)/.transactions(false)at the write examples and nodisableTransactions. Behavior is unchanged:transactions(false)is exactly equivalent to the priordisableTransactions(true).Downstream effect
Merging to
maintriggerssync-sdks.yaml, which regenerates each SDK and opens a sync PR in the SDK repo. The resulting java-sdk PR will carry this README change. It will also carry pre-existing drift in the Retries section (position and wording), which comes fromREADME_retries.mustacheand predates this change, not from this PR. Reviewers of the java-sdk sync PR should expect those extra lines.Why now
This is step 1 of retiring
disableTransactions. Review on openfga/java-sdk#352 flagged that public guidance still teaches the double-negative method. The old methods cannot be deprecated until the docs and examples stop teaching them, and the deprecation stays blocked until this change ships in a release.Out of scope
docs/GENERATING-A-NEW-SDK.md, which prescribesdisableTransactionsas a cross-SDK property. The Go, JS, Python, and .NET SDKs use different transaction option shapes, so aligning the shared spec is a separate cross-SDK design question.Refs #718
Summary by CodeRabbit
transactionsoption for write operations.